I constantly see people on Reddit /r/ece, /r/electronics, etc asking for advice on how to drive LEDs. It happens at least once a week. The classic approach is to take the input voltage, subtract the LED's forward voltage, and then use V = IR to compute the appropriate resistor. And that does work.
(
But there's another way. In my opinion, a better way. )